<template>
  <div>
    <ul>
      <li
      @click="$router.push('/detail/'+m.nm)"
       v-for="(m,index) in movielist" :key="index">
        <img :src="m.img|formatImg('100.200')" alt="">
        <h1>{{m.nm}}</h1>
      </li>
    </ul>
  </div>
</template>
<script>
export default {
  filters: {
    formatImg(val, params) {
      return val.replace(/w.h/, params)
    }
  },
  data() {
    return {
      movielist: [
        {
          img:
            "http://p0.meituan.net/w.h/moviemachine/7e6118993dbf0f304ac1dad4667fddda207318.jpg",
          nm: "我在时间尽头等你"
        },
        {
          img:
            "http://p1.meituan.net/w.h/moviemachine/3b8ab40ddd5e499a6c2924f7c34b03702316978.jpg",
          nm: "木兰：横空出世111"
        }
      ]
    }
  }
}
</script>

